//
// Created by Administrator on 2023/7/31.
//
#include <vector>
#include <iostream>
#include <algorithm>
#include <numeric>

using namespace std;

class Solution {
public:
    vector<int> rowAndMaximumOnes(vector<vector<int>> &mat) {
        int curMax = 0, maxIndex = 0;
        for (int i = 0; i < mat.size(); ++i) {
            int rowSum = accumulate(mat[i].begin(), mat[i].end(), 0);
            if (rowSum > curMax) {
                curMax = rowSum;
                maxIndex = i;
            }
        }
        return vector<int>{maxIndex,curMax};
    }
};


int main() {
    vector<vector<int>> mat{{0, 1, 1, 1,},
                            {1, 0, 0, 0}};
    Solution s;
    auto ans = s.rowAndMaximumOnes(mat);
    for (auto &x: ans) cout << x << endl;


}
